package com.lingxin.gps.wap.command;

import com.jfinal.kit.StrKit;
import com.lingxin.gps.sdk.GpsDeviceApi;
import com.pisces.core.BaseCommand;

/**
 *
 */
public class CUserLogout extends BaseCommand {

	private Long uid;
	private String token;

	@Override
	public void init() throws Exception {
		uid = context.getAttr("uid");
		token = context.getAttr("token");
	}

	@Override
	public void doCommand() throws Exception {
		if(uid != null && StrKit.notBlank(token)){
			context.removeCookie("uid");
			context.removeCookie("token");

			GpsDeviceApi.userLogout(uid, token);
		}
	}

}
